﻿using ProgrammingEducationSystem.Models;

namespace ProgrammingEducationSystem.Services.IServices
{

    //课程接口
    public interface ICoursesService
    {
        //查询
        /// <summary>
        /// 查询所有课程
        /// </summary>
        /// <returns></returns>
        Task<List<Course>?> AllAsync();

        /// <summary>
        /// 根据课程Id查询课程
        /// </summary>
        /// <param name="courseId"></param>
        /// <returns></returns>
        Task<Course?> GetByIdAsync(Guid courseId);


        /// <summary>
        /// 查出某个老师的所有课程
        /// </summary>
        /// <param name="teacherId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByTeacherIdAsync(string teacherId);

        /// <summary>
        /// 查出某个学生的所有课程
        /// </summary>
        /// <param name="teacherId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByStudentIdAsync(string studentId);

        /// <summary>
        /// 查出某个班级的所有课程
        /// </summary>
        /// <param name="teacherId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByClassIdAsync(Guid classId);

        /// <summary>
        /// 查出某个课程类型的所有课程
        /// </summary>
        /// <param name="classTypeId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByClassTypeAsync(Guid classTypeId);
        /// <summary>
        /// 查出某个班级的所有课程
        /// </summary>
        /// <param name="classTypeName"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByClassTypeAsync(string classTypeName);

        /// <summary>
        /// 查出某个学生的某种类型的所有课程
        /// </summary>
        /// <param name="stuId"></param>
        /// <param name="classTypeId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByStuAndClassTypeAsync(string stuId,Guid classTypeId);

        /// <summary>
        /// 查出某个教师的某种类型的所有课程
        /// </summary>
        /// <param name="teaId"></param>
        /// <param name="classTypeId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByTeaAndClassTypeAsync(string teaId,Guid classTypeId);

        /// <summary>
        /// 查询某个老师所有已经结束的课程
        /// </summary>
        /// <param name="teaId"></param>
        /// <param name="classTypeId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByTeaAndExpiredAsync(string teaId);
        /// <summary>
        /// 查询某个老师所有未结束的课程
        /// </summary>
        /// <param name="teaId"></param>
        /// <param name="classTypeId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByTeaAndNotExpiredAsync(string teaId);


        /// <summary>
        /// 查询某个学生所有已结束的课程
        /// </summary>
        /// <param name="teaId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByStuAndExpiredAsync(string stuId);

        /// <summary>
        /// 查询某个学生所有未结束的课程
        /// </summary>
        /// <param name="stuId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByStuAndNotExpiredAsync(string stuId);

        /// <summary>
        /// 查询某个班级所有已经结束的课程
        /// </summary>
        /// <param name="classId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByClassAndExpiredAsync(Guid classId);
        
        /// <summary>
        /// 查询某个班级所有未结束的课程
        /// </summary>
        /// <param name="classId"></param>
        /// <returns></returns>
        Task<List<Course>?> GetByClassAndNotExpiredAsync(Guid classId);


        //删除

        /// <summary>
        /// 删除某套课程 
        /// ==》 级联删除课程中的所有课时
        /// ==》 级联删除课时中的所有学习资料
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task DeleteAsync(Guid id);

        //新增

        /// <summary>
        /// 新增课程
        /// </summary>
        /// <param name="course"></param>
        /// <returns></returns>
        Task AddAsync(Course course);

        //修改
        /// <summary>
        /// 更新课程信息
        /// </summary>
        /// <param name="course"></param>
        /// <returns></returns>
        void Update(Course course);

        Task<bool> SaveAsync();

    }
}
